<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name ="keywords" content="{{$metakeyword}}">
    <meta name="description" content="{{$metadesp}}">
    <title>个人中心-个人的直播秀</title>
    <link rel="stylesheet" href="/css/layout.css">
    <link rel="stylesheet" href="/css/lay_icon.css">
    <link rel="stylesheet" href="/css/index.css">
    <script src="/js/jquery-3.1.1.js"></script>
    <script src="/js/layer/1.9.3/layer.js"></script>
</head>
<body>
<div class="header">
    <div class="logo">
        <a href="">MINI秀 <b>bete1.0</b></a>
    </div>
    <div class="l_rt">
        @if($user['islogin'])
            <div class="login_user">
                <div class="user_info">
                    <div class="user_icon">
                        <img src="{{$user['bigpic']}}" alt="">
                    </div>
                    <div class="user_name"><a href="/profile">{{$user['username']}}</a></div>
                </div>
                <a href="" style="font-size: 14px">退出</a>
            </div>
        @else
            <a href="javascript:;" onclick="login()">登录</a>
            <a href="javascript:;" onclick="register()">注册</a>
        @endif
    </div>
</div>
<div class="content" style="clear: both; overflow: auto;">
    <div class="setbar">
        <ul>
            <li><a href="/"><i class="home"></i><span>首页</span></a></li>
            <li><a href="/cate/index"><i class="cate"></i><span>分类</span></a></li>
            <li><a href=""><i class="gc"></i><span>广场</span></a></li>
            <li><a href=""><i class="fa"></i><span>Fans</span></a></li>
            <li><i class="hide"></i><span>隐藏</span></li>
        </ul>
    </div>
    <div class="con" style="width: 95%; height: 900px; float: right;">
        <div class="profile_head">
            <div class="cover_bg">

            </div>
            <div class="profile_user">
                <div class="profile_user_icon">
                    <img src="{{$user['bigpic']}}" alt="">
                </div>
                <div class="profile_user_info">
                    <h3>{{$user['nickname']}}</h3>
                    <p>等级：{{$user['level_common']}}</p>
                    <div class="user_intro">
                        @if($user['interest']) {{$user['interest']}} @else 这家伙很懒，什么都没写 @endif <span class="edit"></span>
                    </div>
                </div>
            </div>
            <div class="nav_item">
                <ul>
                    <li><a href="">个人中心</a></li>
                    <li><a href="">账号安全</a></li>
                    <li><a href="">我的关注</a></li>
                </ul>
            </div>
            <div class="box">
                <form action="/profile/applyfodo" method="post">
                @if ($data['isauth'])
                <div class="box_auth">
                    <div class="auth_title">房间申请</div>
                    @if(empty($data['isApply']))
                    <div class="form_row">
                        <span>房间标题:</span>
                        <input type="text" name="title" placeholder="请填写你要申请的房间标题">
                    </div>
                    <div class="form_row">
                        <span>直播分类:</span>
                        <div class="room_cate">
                            <input type="hidden" name="type" id="cateseledhiden">
                            <b id="cateseled"></b><a href="javascrip:;" onclick="showCate()">选择分类</a>
                        </div>
                    </div>
                    <div class="form_row">
                        <span>联系方式:</span>
                        <input type="text" name="contact" placeholder="请输入你的联系方式">
                    </div>
                    <div class="form_row">
                        <span>描述:</span>
                        <textarea name="intro"></textarea>
                    </div>
                    {{csrf_field()}}
                    <div class="form_row">
                        <span></span>
                        <input type="button" class="sub" onclick="doSub()" value="提交申请">
                    </div>
                    @else
                        @if($data['isApply']['original']=='n')
                             <div class="room_verify">
                                  <div class="roomver_icon"></div>
                                  <div class="v_test">
                                       您申请的房间正在审核中，请稍等
                                  </div>
                             </div>
                        @else
                             <div class="room_success">
                                   <p>您已有直播间</p>
                                   <a href="">去直播间</a>
                             </div>
                        @endif
                    @endif
                </div>
                </form>
                    @else
                    <div class="no_auth">
                         <h3>未进行实名认证</h3>
                         <p>主播认证需要您完成实名认证</p>
                         <a href="authtruename">去实名认证</a>
                    </div>
                @endif
            </div>

        </div>
    </div>
</div>
<div class="footer"></div>
<div class="windowlayout" style="display: none;">
    <div class="windowDiag" style="width: 350px;">
        <div class="w_title">直播分类 <a href="" class="w_close"></a></div>
        <div class="w_form">
            <div class="d_tips">请选择下面直播分类</div>
            <div class="tag1">
                 @foreach($data['cate'] as $v)
                    <a href="javascript:;" cid="{{$v['id']}}">{{$v['catename']}}</a>
                 @endforeach
            </div>
        </div>
        <div class="w_form_sub">
            <input type="submit" class="confim" value="确定">
        </div>
    </div>
</div>
</body>
</html>
<script>
    function showCate() {
         var windowlayout = document.getElementsByClassName('windowlayout')[0];
         windowlayout.style.display = 'block';
         var taga = document.getElementsByClassName('tag1')[0].getElementsByTagName('a');
         var cateseled = document.getElementById('cateseled');
         for (var i=0;i<taga.length;i++){
             taga[i].onclick = function () {
                   var cid = this.getAttribute('cid');
                   cateseled.innerHTML = this.innerHTML;
                   document.getElementById('cateseledhiden').value = cid;
             }
         }
         var confim = document.getElementsByClassName('confim')[0];
         confim.onclick = function () {
             windowlayout.style.display = 'none';
         }
    }

    function doSub() {
          var input = document.getElementsByClassName('box')[0].getElementsByTagName('input');
          if (input[0].value==''){
               layer.msg('请填写房间标题');
               return;
          }
          if (input[1].value==''){
            layer.msg('请选择房间分类');
            return;
          }
          if (input[2].value==''){
            layer.msg('请填写联系电话');
            return;
          }
         if (input[3].value==''){
            layer.msg('请填写介绍');
            return;
         }
         var from = document.getElementsByTagName('form')[0];
         from.submit();
    }
</script>